<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 13] Java Syntax</TITLE>
<META NAME="author" CONTENT="David Flanagan">
<META NAME="date" CONTENT="Thu Jul 31 16:00:46 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java in a Nutshell">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java in a Nutshell" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch12_02.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 13</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch13_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JNUT2-CH-13">13. Java Syntax</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
Primitive Data Types<br>
<A HREF="ch13_02.htm">Character Escape Sequences</A><BR>
<A HREF="ch13_03.htm">Operators</A><BR>
<A HREF="ch13_04.htm">Modifiers</A><BR>
<A HREF="ch13_05.htm">Reserved Words</A><BR>
<A HREF="ch13_06.htm">Java Documentation Comment Syntax</A><BR>

<p>
</DIV>

<DIV CLASS=sect1>
<h2 CLASS=sect1><A CLASS="TITLE" NAME="JNUT2-CH-13-SECT-1">13.1 Primitive Data Types</A></h2>

<P CLASS=para>
<A NAME="CH13.PRIMITIVE.DA1"></A><A NAME="CH13.DATA.TYPES-P1"></A>Java supports a complete set of primitive data types, listed
in <A HREF="ch13_01.htm#JNUT2-CH-13-TAB-1">Table 13.1</A>.
In Java, the size of each type is defined by the language,
and is <I CLASS=emphasis>not</I> implementation dependent, as it is in C.

<P>
<DIV CLASS=table>
<TABLE BORDER>
<CAPTION><A CLASS="TITLE" NAME="JNUT2-CH-13-TAB-1">Table 13.1: Java Primitive Data Types</A></CAPTION>
<TR CLASS=row>
<TH ALIGN="left">&nbsp;</TH>
<TH ALIGN="left">&nbsp;</TH>
<TH ALIGN="left">&nbsp;</TH>
<TH ALIGN="left">&nbsp;</TH>
<TH ALIGN="left">Min Value</TH>
</TR>
<TR CLASS=row>
<TH ALIGN="left">Type</TH>
<TH ALIGN="left">Contains</TH>
<TH ALIGN="left">Default</TH>
<TH ALIGN="left">Size</TH>
<TH ALIGN="left">Max Value</TH>
</TR>
<TR CLASS=row>
<TD ALIGN="left">boolean</TD>
<TD ALIGN="left"><tt CLASS=literal>true</tt> or <tt CLASS=literal>false</tt></TD>
<TD ALIGN="left"><tt CLASS=literal>false</tt></TD>
<TD ALIGN="left">1 bit</TD>
<TD ALIGN="left">N.A.</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">N.A.</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">char</TD>
<TD ALIGN="left">Unicode character</TD>
<TD ALIGN="left"><tt CLASS=literal>\u0000</tt></TD>
<TD ALIGN="left">16 bits</TD>
<TD ALIGN="left"><tt CLASS=literal>\u0000</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left"><tt CLASS=literal>\uFFFF</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">byte</TD>
<TD ALIGN="left">signed integer</TD>
<TD ALIGN="left"><tt CLASS=literal>0</tt></TD>
<TD ALIGN="left">8 bits</TD>
<TD ALIGN="left">-128</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">127</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">short</TD>
<TD ALIGN="left">signed integer</TD>
<TD ALIGN="left"><tt CLASS=literal>0</tt></TD>
<TD ALIGN="left">16 bits</TD>
<TD ALIGN="left">-32768</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">32767</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">int</TD>
<TD ALIGN="left">signed integer</TD>
<TD ALIGN="left"><tt CLASS=literal>0</tt></TD>
<TD ALIGN="left">32 bits</TD>
<TD ALIGN="left">-2147483648</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">2147483647</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">long</TD>
<TD ALIGN="left">signed integer</TD>
<TD ALIGN="left"><tt CLASS=literal>0</tt></TD>
<TD ALIGN="left">64 bits</TD>
<TD ALIGN="left">-9223372036854775808</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">9223372036854775807</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">float</TD>
<TD ALIGN="left">IEEE 754</TD>
<TD ALIGN="left"><tt CLASS=literal>0.0</tt></TD>
<TD ALIGN="left">32 bits</TD>
<TD ALIGN="left">+/-3.40282347E+38</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">floating-point</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">+/-1.40239846E-45</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">double</TD>
<TD ALIGN="left">IEEE 754</TD>
<TD ALIGN="left"><tt CLASS=literal>0.0</tt></TD>
<TD ALIGN="left">64 bits</TD>
<TD ALIGN="left">+/-1.79769313486231570E+308</TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">floating-point</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">+/-4.94065645841246544E-324</TD>
</TR>
</TABLE>
<P>
</DIV>
<P CLASS=para>
</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch12_02.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch13_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Invoking a Named Method</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>Character Escape Sequences</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
